﻿namespace DesignModeConsole.OOPAndPOP.AuthSample
{
    /// <summary>
    /// 组件的获取存储的密码
    /// </summary>
    public interface ICredentialStorage
    {
        /*
         从存储中取出 AppID 和对应的密码。
         */

        string GetPasswordByAppId(string appId);
    }

    public class MysqlCredentialStorage : ICredentialStorage
    {
        public string GetPasswordByAppId(string appId)
        {
            if (appId == "123456")
                return "654321";
            return appId + "123456";
        }
    }
}